//
//  DestAllHotCityTableViewCell.m
//  TravelEveryDay
//
//  Created by dlios on 15/10/24.
//  Copyright © 2015年 com.lanou3g. All rights reserved.
//

#import "DestAllHotCityTableViewCell.h"
#import "BaseHeader.h"
@implementation DestAllHotCityTableViewCell

- (void)awakeFromNib {
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _backView = [[UIView alloc]initWithFrame:CGRectMake(10 *WIDTH , 5 *HEIGHT, 355 *WIDTH, 140 *HEIGHT)];
        _backView.backgroundColor = [UIColor whiteColor];
        _backView.layer.cornerRadius = 10;
        _backView.layer.masksToBounds = YES;
        _tuiJianImageView = [[UIImageView alloc]initWithFrame:CGRectMake(310 *WIDTH, -2, 30 *WIDTH, 30 *HEIGHT)];
        _destAllHotCityImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10 *WIDTH, 10 *HEIGHT, 120 * WIDTH, 120 *HEIGHT)];
        _destAllHotCityNameLable = [[UILabel alloc]initWithFrame:CGRectMake(140 *WIDTH, 10 *HEIGHT,170 * WIDTH,30 * HEIGHT)];
        _destAllHotCityNameLable.font = [UIFont boldSystemFontOfSize:20.0f];
        _destAllHotCityRecommended_reasonLabel = [[UILabel alloc]initWithFrame:CGRectMake(140 *WIDTH, 50 *HEIGHT, 205 *WIDTH, 50 *HEIGHT)];
        _destAllHotCityRecommended_reasonLabel.font = [UIFont systemFontOfSize:17.0f];
        _destAllHotCityRecommended_reasonLabel.numberOfLines = 2;
        _destAllHotCityVisited_countLabel = [[UILabel alloc]initWithFrame:CGRectMake(140 *WIDTH, 105 *HEIGHT, 100 *WIDTH, 20 *HEIGHT)];
        _destAllHotCityVisited_countLabel.font = [UIFont systemFontOfSize:15.0f];
        _destAllHotCityVisited_countLabel.textColor = [UIColor lightGrayColor];
        _destAllHotCityTips_countLabel = [[UILabel alloc]initWithFrame:CGRectMake(250 *WIDTH, 105 * HEIGHT, 100 *WIDTH, 20 * HEIGHT)];
        _destAllHotCityTips_countLabel.textColor = _destAllHotCityVisited_countLabel.textColor;
        _destAllHotCityTips_countLabel.font = _destAllHotCityVisited_countLabel.font;
        [self.contentView addSubview:_backView];
        [_backView addSubview:_tuiJianImageView];
        [_backView addSubview:_destAllHotCityImageView];
        [_backView addSubview:_destAllHotCityNameLable];
        [_backView addSubview:_destAllHotCityRecommended_reasonLabel];
        [_backView addSubview:_destAllHotCityVisited_countLabel];
        [_backView  addSubview:_destAllHotCityTips_countLabel];
        
    }
    return self;
}
- (void)setDataModel:(DestAllHotCityModel *)dataModel {
    _dataModel = dataModel;
    _tuiJianImageView.image = [UIImage imageNamed:@"Desticonfont-tuijian.png"];
    NSURL *url = [NSURL URLWithString:dataModel.cover_s];
    [_destAllHotCityImageView sd_setImageWithURL:url placeholderImage:PLACEHOLDERIMAGE];
    _destAllHotCityNameLable.text = dataModel.name;
    _destAllHotCityRecommended_reasonLabel.text = dataModel.recommended_reason;
    _destAllHotCityVisited_countLabel.text = [NSString stringWithFormat:@"%@ 人去过",dataModel.visited_count];
    _destAllHotCityTips_countLabel.text = [NSString stringWithFormat:@"%@ 评论",dataModel.tips_count];
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
